package com.zline.foodraise.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;

import com.zline.foodraise.entity.CfOrderBean;
import com.zline.foodraise.view.RaiseShopOderItem;
import com.zline.foodraise.view.RaiseShopOderItem_;
import com.zline.foodraise.view.RecyclerViewLoadMore_;

import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;

/**
 * Created by heshantao on 15/12/25.
 * 筹店中订单订单管理Adapter
 */
@EBean
public class RaiseShopOrderAdapter extends LoadRecyclerBaseAdapter<CfOrderBean,RaiseShopOderItem> {
    private static final String LOG_TAG = RaiseProductCardAdapter.class.getSimpleName();
    @RootContext
    Context cxt;
    @Override
    protected RaiseShopOderItem onCreateItemView(ViewGroup parent, int viewType) {
        return RaiseShopOderItem_.build(cxt);
    }

    @Override
    protected BottomWrapper onCreateBottomView(ViewGroup parent, int viewType) {
        return new BottomWrapper(RecyclerViewLoadMore_.build(cxt));
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        if (holder instanceof ContentWrapper) {
            RaiseShopOderItem view = (RaiseShopOderItem) ((ContentWrapper) holder).getView();
            CfOrderBean orderBean=arrys.get(position);
            view.setRecyclerItemClick(itemClicked);
            view.bind(orderBean,position,flag);
        }
    }
}
